import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {AreaAnalysisCondition} from '../model/area-analysis-condition';
import {NzTableQueryParams} from 'ng-zorro-antd/table';
import {ContentService} from '../content.service';
import {NzMessageService} from 'ng-zorro-antd/message';
import _ from 'lodash';

@Component({
  selector: 'app-select-condition',
  templateUrl: './select-condition.component.html',
  styleUrls: ['./select-condition.component.less']
})
export class SelectConditionComponent implements OnInit {

  areaOptions: any[] | null = null;         // 当前显示的区域。
  areaOptionsAll: any[] | null = null;      // 全部区域。
  areaValues: string[] = [];
  organOptions: any[] | null = null;            // 显示的发布机构, 根据所选的颁布地域调整。
  organOptionsClone: any[] | null = null;            // 显示的发布机构, 根据所选的颁布地域调整。
  organOptionsAll: any[] | null = null;        // 全部的发布机构
  filesOptions: any[] | null = null;
  organValues: string[] = [];
  spotList = [];
  specialTwo = [
    {label: '自由贸易区', value: '自由贸易区'},
    {label: '科学城', value: '科学城'},
  ];
  specialThree = [
    {label: '国家自主创新示范区', value: '国家自主创新示范区', checked: false},
    {label: '科技创新中心', value: '科技创新中心', checked: false},
    {label: '综合性国家科学中心', value: '综合性国家科学中心', checked: false},
  ];
  specialThreeOption = {
    国家自主创新示范区: ['北京', '武汉', '上海', '深圳', '南京', '苏州', '天津', '杭州', '广州', '珠海', '福州', '厦门', '合肥'],
    科技创新中心: ['北京', '上海', '广州', '深圳', '珠海'],
    综合性国家科学中心: ['上海', '合肥', '北京', '深圳']
  };
  frames = [];
  frameIdList = [];
  frameIdListCondition = [];
  frameCheckListCondition = [];
  date = null;
  fileValues: string[] = [];
  areaAnalysis = new AreaAnalysisCondition();
  @Output() selectResult = new EventEmitter<AreaAnalysisCondition>();
  @Input() isShow = true;

  constructor(private cService: ContentService,
              private message: NzMessageService) {
  }

  ngOnInit(): void {
    this.getRegion();
    this.getOrgans();
    this.getFileList();
    this.getHotSpots();
    this.getFrameList();
  }

  getFrameList() {

      // 是否启用缓存。 写死数据
    if( 1 ){
      let res = {"code":200,"msg":"成功","result":[{"id":1,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科创要素","level":1,"weight":0,"label":"科创要素","children":[{"id":2,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"愿景","level":2,"weight":0,"label":"愿景","children":[{"id":3,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"目标定位","level":3,"weight":0,"label":"目标定位","children":null,"key":3,"title":"目标定位","isLeaf":true},{"id":4,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"发展思路","level":3,"weight":0,"label":"发展思路","children":null,"key":4,"title":"发展思路","isLeaf":true},{"id":5,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"方向重点","level":3,"weight":0,"label":"方向重点","children":null,"key":5,"title":"方向重点","isLeaf":true}],"key":2,"title":"愿景","isLeaf":false},{"id":6,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"空间","level":2,"weight":0,"label":"空间","children":[{"id":7,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"规划布局","level":3,"weight":0,"label":"规划布局","children":null,"key":7,"title":"规划布局","isLeaf":true},{"id":8,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"开发利用","level":3,"weight":0,"label":"开发利用","children":null,"key":8,"title":"开发利用","isLeaf":true},{"id":9,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"配套保障","level":3,"weight":0,"label":"配套保障","children":null,"key":9,"title":"配套保障","isLeaf":true},{"id":10,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"效益评价","level":3,"weight":0,"label":"效益评价","children":null,"key":10,"title":"效益评价","isLeaf":true}],"key":6,"title":"空间","isLeaf":false},{"id":11,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"平台基地","level":2,"weight":0,"label":"平台基地","children":[{"id":12,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"设施设备","level":3,"weight":0,"label":"设施设备","children":null,"key":12,"title":"设施设备","isLeaf":true},{"id":13,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"基地","level":3,"weight":0,"label":"基地","children":null,"key":13,"title":"基地","isLeaf":true},{"id":14,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"平台","level":3,"weight":0,"label":"平台","children":null,"key":14,"title":"平台","isLeaf":true}],"key":11,"title":"平台基地","isLeaf":false},{"id":15,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"项目计划","level":2,"weight":0,"label":"项目计划","children":[{"id":16,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科学计划","level":3,"weight":0,"label":"科学计划","children":null,"key":16,"title":"科学计划","isLeaf":true},{"id":17,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科研项目","level":3,"weight":0,"label":"科研项目","children":null,"key":17,"title":"科研项目","isLeaf":true}],"key":15,"title":"项目计划","isLeaf":false},{"id":18,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科技人才","level":2,"weight":0,"label":"科技人才","children":[{"id":19,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"人才培育","level":3,"weight":0,"label":"人才培育","children":null,"key":19,"title":"人才培育","isLeaf":true},{"id":20,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"人才引进","level":3,"weight":0,"label":"人才引进","children":null,"key":20,"title":"人才引进","isLeaf":true},{"id":21,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"人才保障","level":3,"weight":0,"label":"人才保障","children":null,"key":21,"title":"人才保障","isLeaf":true},{"id":22,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"人才流动","level":3,"weight":0,"label":"人才流动","children":null,"key":22,"title":"人才流动","isLeaf":true},{"id":23,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"使用管理","level":3,"weight":0,"label":"使用管理","children":null,"key":23,"title":"使用管理","isLeaf":true},{"id":24,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"人才创业","level":3,"weight":0,"label":"人才创业","children":null,"key":24,"title":"人才创业","isLeaf":true}],"key":18,"title":"科技人才","isLeaf":false},{"id":25,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"知识","level":2,"weight":0,"label":"知识","children":[{"id":26,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"创造","level":3,"weight":0,"label":"创造","children":null,"key":26,"title":"创造","isLeaf":true},{"id":27,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"权益","level":3,"weight":0,"label":"权益","children":null,"key":27,"title":"权益","isLeaf":true},{"id":28,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"保护","level":3,"weight":0,"label":"保护","children":null,"key":28,"title":"保护","isLeaf":true},{"id":29,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"运用","level":3,"weight":0,"label":"运用","children":null,"key":29,"title":"运用","isLeaf":true}],"key":25,"title":"知识","isLeaf":false},{"id":30,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"资本","level":2,"weight":0,"label":"资本","children":[{"id":31,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"投资","level":3,"weight":0,"label":"投资","children":null,"key":31,"title":"投资","isLeaf":true},{"id":32,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"借贷","level":3,"weight":0,"label":"借贷","children":null,"key":32,"title":"借贷","isLeaf":true},{"id":33,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"债券","level":3,"weight":0,"label":"债券","children":null,"key":33,"title":"债券","isLeaf":true},{"id":34,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"租赁","level":3,"weight":0,"label":"租赁","children":null,"key":34,"title":"租赁","isLeaf":true},{"id":35,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"上市","level":3,"weight":0,"label":"上市","children":null,"key":35,"title":"上市","isLeaf":true},{"id":36,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"众筹","level":3,"weight":0,"label":"众筹","children":null,"key":36,"title":"众筹","isLeaf":true},{"id":37,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"保险","level":3,"weight":0,"label":"保险","children":null,"key":37,"title":"保险","isLeaf":true},{"id":38,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"担保","level":3,"weight":0,"label":"担保","children":null,"key":38,"title":"担保","isLeaf":true},{"id":39,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"其他","level":3,"weight":0,"label":"其他","children":null,"key":39,"title":"其他","isLeaf":true}],"key":30,"title":"资本","isLeaf":false}],"key":1,"title":"科创要素","isLeaf":false},{"id":40,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科创主体","level":1,"weight":0,"label":"科创主体","children":[{"id":41,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"政","level":2,"weight":0,"label":"政","children":[{"id":42,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"部门","level":3,"weight":0,"label":"部门","children":null,"key":42,"title":"部门","isLeaf":true},{"id":43,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"园区","level":3,"weight":0,"label":"园区","children":null,"key":43,"title":"园区","isLeaf":true}],"key":41,"title":"政","isLeaf":false},{"id":44,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"产","level":2,"weight":0,"label":"产","children":[{"id":45,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"高新技术企业","level":3,"weight":0,"label":"高新技术企业","children":null,"key":45,"title":"高新技术企业","isLeaf":true},{"id":46,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"中小微企业","level":3,"weight":0,"label":"中小微企业","children":null,"key":46,"title":"中小微企业","isLeaf":true},{"id":47,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"初创企业","level":3,"weight":0,"label":"初创企业","children":null,"key":47,"title":"初创企业","isLeaf":true},{"id":48,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"民营企业","level":3,"weight":0,"label":"民营企业","children":null,"key":48,"title":"民营企业","isLeaf":true},{"id":49,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"国有企业","level":3,"weight":0,"label":"国有企业","children":null,"key":49,"title":"国有企业","isLeaf":true},{"id":50,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"外资企业","level":3,"weight":0,"label":"外资企业","children":null,"key":50,"title":"外资企业","isLeaf":true},{"id":51,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"其他企业","level":3,"weight":0,"label":"其他企业","children":null,"key":51,"title":"其他企业","isLeaf":true},{"id":52,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"产业协会","level":3,"weight":0,"label":"产业协会","children":null,"key":52,"title":"产业协会","isLeaf":true}],"key":44,"title":"产","isLeaf":false},{"id":53,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"学 研","level":2,"weight":0,"label":"学 研","children":[{"id":54,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"高等院校","level":3,"weight":0,"label":"高等院校","children":null,"key":54,"title":"高等院校","isLeaf":true},{"id":55,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"职业院校","level":3,"weight":0,"label":"职业院校","children":null,"key":55,"title":"职业院校","isLeaf":true},{"id":56,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"中小学","level":3,"weight":0,"label":"中小学","children":null,"key":56,"title":"中小学","isLeaf":true},{"id":57,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科研院所","level":3,"weight":0,"label":"科研院所","children":null,"key":57,"title":"科研院所","isLeaf":true},{"id":58,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"实验室","level":3,"weight":0,"label":"实验室","children":null,"key":58,"title":"实验室","isLeaf":true},{"id":59,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"企业研发机构","level":3,"weight":0,"label":"企业研发机构","children":null,"key":59,"title":"企业研发机构","isLeaf":true},{"id":60,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"研发平台","level":3,"weight":0,"label":"研发平台","children":null,"key":60,"title":"研发平台","isLeaf":true}],"key":53,"title":"学 研","isLeaf":false},{"id":61,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"资","level":2,"weight":0,"label":"资","children":[{"id":62,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科技银行","level":3,"weight":0,"label":"科技银行","children":null,"key":62,"title":"科技银行","isLeaf":true},{"id":63,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"政府基金","level":3,"weight":0,"label":"政府基金","children":null,"key":63,"title":"政府基金","isLeaf":true},{"id":64,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"风险投资","level":3,"weight":0,"label":"风险投资","children":null,"key":64,"title":"风险投资","isLeaf":true},{"id":65,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"保险公司","level":3,"weight":0,"label":"保险公司","children":null,"key":65,"title":"保险公司","isLeaf":true},{"id":66,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"证券机构","level":3,"weight":0,"label":"证券机构","children":null,"key":66,"title":"证券机构","isLeaf":true},{"id":67,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"担保公司","level":3,"weight":0,"label":"担保公司","children":null,"key":67,"title":"担保公司","isLeaf":true},{"id":68,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"小额贷款公司","level":3,"weight":0,"label":"小额贷款公司","children":null,"key":68,"title":"小额贷款公司","isLeaf":true},{"id":69,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"融资租赁公司","level":3,"weight":0,"label":"融资租赁公司","children":null,"key":69,"title":"融资租赁公司","isLeaf":true}],"key":61,"title":"资","isLeaf":false},{"id":70,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"介","level":2,"weight":0,"label":"介","children":[{"id":71,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"转移转化","level":3,"weight":0,"label":"转移转化","children":null,"key":71,"title":"转移转化","isLeaf":true},{"id":72,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"检验检测认证","level":3,"weight":0,"label":"检验检测认证","children":null,"key":72,"title":"检验检测认证","isLeaf":true},{"id":73,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"创业孵化","level":3,"weight":0,"label":"创业孵化","children":null,"key":73,"title":"创业孵化","isLeaf":true},{"id":74,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"知识产权","level":3,"weight":0,"label":"知识产权","children":null,"key":74,"title":"知识产权","isLeaf":true},{"id":75,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科技咨询","level":3,"weight":0,"label":"科技咨询","children":null,"key":75,"title":"科技咨询","isLeaf":true},{"id":76,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"","level":3,"weight":0,"label":"","children":null,"key":76,"title":"","isLeaf":true}],"key":70,"title":"介","isLeaf":false},{"id":77,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"用","level":2,"weight":0,"label":"用","children":[{"id":78,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"政府采购","level":3,"weight":0,"label":"政府采购","children":null,"key":78,"title":"政府采购","isLeaf":true},{"id":79,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"市场用户","level":3,"weight":0,"label":"市场用户","children":null,"key":79,"title":"市场用户","isLeaf":true}],"key":77,"title":"用","isLeaf":false}],"key":40,"title":"科创主体","isLeaf":false},{"id":80,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科创环节","level":1,"weight":0,"label":"科创环节","children":[{"id":81,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科学","level":2,"weight":0,"label":"科学","children":[{"id":82,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"数理科学","level":3,"weight":0,"label":"数理科学","children":null,"key":82,"title":"数理科学","isLeaf":true},{"id":83,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"化学科学","level":3,"weight":0,"label":"化学科学","children":null,"key":83,"title":"化学科学","isLeaf":true},{"id":84,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"生命科学","level":3,"weight":0,"label":"生命科学","children":null,"key":84,"title":"生命科学","isLeaf":true},{"id":85,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"地球科学","level":3,"weight":0,"label":"地球科学","children":null,"key":85,"title":"地球科学","isLeaf":true},{"id":86,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"工程与材料科学","level":3,"weight":0,"label":"工程与材料科学","children":null,"key":86,"title":"工程与材料科学","isLeaf":true},{"id":87,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"信息科学","level":3,"weight":0,"label":"信息科学","children":null,"key":87,"title":"信息科学","isLeaf":true}],"key":81,"title":"科学","isLeaf":false},{"id":88,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"技术","level":2,"weight":0,"label":"技术","children":[{"id":89,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"电子与信息技术","level":3,"weight":0,"label":"电子与信息技术","children":null,"key":89,"title":"电子与信息技术","isLeaf":true},{"id":90,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"生物与新医药技术","level":3,"weight":0,"label":"生物与新医药技术","children":null,"key":90,"title":"生物与新医药技术","isLeaf":true},{"id":91,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"航空航天技术","level":3,"weight":0,"label":"航空航天技术","children":null,"key":91,"title":"航空航天技术","isLeaf":true},{"id":92,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"新材料技术","level":3,"weight":0,"label":"新材料技术","children":null,"key":92,"title":"新材料技术","isLeaf":true},{"id":93,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"新能源与节能技术","level":3,"weight":0,"label":"新能源与节能技术","children":null,"key":93,"title":"新能源与节能技术","isLeaf":true},{"id":94,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"资源与环境技术","level":3,"weight":0,"label":"资源与环境技术","children":null,"key":94,"title":"资源与环境技术","isLeaf":true},{"id":95,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"先进制造与自动化技术","level":3,"weight":0,"label":"先进制造与自动化技术","children":null,"key":95,"title":"先进制造与自动化技术","isLeaf":true},{"id":96,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"高技术服务技术","level":3,"weight":0,"label":"高技术服务技术","children":null,"key":96,"title":"高技术服务技术","isLeaf":true}],"key":88,"title":"技术","isLeaf":false},{"id":97,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"产业","level":2,"weight":0,"label":"产业","children":[{"id":98,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"节能环保产业","level":3,"weight":0,"label":"节能环保产业","children":null,"key":98,"title":"节能环保产业","isLeaf":true},{"id":99,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"新一代信息技术产业","level":3,"weight":0,"label":"新一代信息技术产业","children":null,"key":99,"title":"新一代信息技术产业","isLeaf":true},{"id":100,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"生物产业","level":3,"weight":0,"label":"生物产业","children":null,"key":100,"title":"生物产业","isLeaf":true},{"id":101,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"高端装备制造产业","level":3,"weight":0,"label":"高端装备制造产业","children":null,"key":101,"title":"高端装备制造产业","isLeaf":true},{"id":102,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"新能源产业","level":3,"weight":0,"label":"新能源产业","children":null,"key":102,"title":"新能源产业","isLeaf":true},{"id":103,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"新材料产业","level":3,"weight":0,"label":"新材料产业","children":null,"key":103,"title":"新材料产业","isLeaf":true},{"id":104,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"新能源汽车产业","level":3,"weight":0,"label":"新能源汽车产业","children":null,"key":104,"title":"新能源汽车产业","isLeaf":true}],"key":97,"title":"产业","isLeaf":false}],"key":80,"title":"科创环节","isLeaf":false},{"id":105,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科创环境","level":1,"weight":0,"label":"科创环境","children":[{"id":106,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"协同合作","level":2,"weight":0,"label":"协同合作","children":[{"id":107,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"产学研协同","level":3,"weight":0,"label":"产学研协同","children":null,"key":107,"title":"产学研协同","isLeaf":true},{"id":108,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科技成果转移转化","level":3,"weight":0,"label":"科技成果转移转化","children":null,"key":108,"title":"科技成果转移转化","isLeaf":true},{"id":109,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"区域协同","level":3,"weight":0,"label":"区域协同","children":null,"key":109,"title":"区域协同","isLeaf":true},{"id":110,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"国际合作","level":3,"weight":0,"label":"国际合作","children":null,"key":110,"title":"国际合作","isLeaf":true},{"id":111,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"军民融合","level":3,"weight":0,"label":"军民融合","children":null,"key":111,"title":"军民融合","isLeaf":true}],"key":106,"title":"协同合作","isLeaf":false},{"id":112,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"财政税收","level":2,"weight":0,"label":"财政税收","children":[{"id":113,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"财政支持","level":3,"weight":0,"label":"财政支持","children":null,"key":113,"title":"财政支持","isLeaf":true},{"id":114,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"税费减免","level":3,"weight":0,"label":"税费减免","children":null,"key":114,"title":"税费减免","isLeaf":true}],"key":112,"title":"财政税收","isLeaf":false},{"id":115,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"公共服务","level":2,"weight":0,"label":"公共服务","children":[{"id":116,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"信息公开","level":3,"weight":0,"label":"信息公开","children":null,"key":116,"title":"信息公开","isLeaf":true},{"id":117,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"出境入境","level":3,"weight":0,"label":"出境入境","children":null,"key":117,"title":"出境入境","isLeaf":true},{"id":118,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"市场监管","level":3,"weight":0,"label":"市场监管","children":null,"key":118,"title":"市场监管","isLeaf":true},{"id":119,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"审批许可","level":3,"weight":0,"label":"审批许可","children":null,"key":119,"title":"审批许可","isLeaf":true}],"key":115,"title":"公共服务","isLeaf":false},{"id":120,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"文化氛围","level":2,"weight":0,"label":"文化氛围","children":[{"id":121,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科技普及","level":3,"weight":0,"label":"科技普及","children":null,"key":121,"title":"科技普及","isLeaf":true},{"id":122,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"科创活动","level":3,"weight":0,"label":"科创活动","children":null,"key":122,"title":"科创活动","isLeaf":true},{"id":123,"createDate":"2020-10-28","updateDate":"2020-10-28","deleteDate":null,"name":"伦理道德","level":3,"weight":0,"label":"伦理道德","children":null,"key":123,"title":"伦理道德","isLeaf":true}],"key":120,"title":"文化氛围","isLeaf":false}],"key":105,"title":"科创环境","isLeaf":false}],"ok":true};
      this.frames = res.result;
      for (let i = 0; i < this.frames.length; i++) {
        this.frameIdList.push(['']);
        this.frameIdListCondition[i] = [''];
      }
      return;
    }

    this.cService.getFrameList().subscribe(res => {
      this.frames = res.result;
      for (let i = 0; i < this.frames.length; i++) {
        this.frameIdList.push(['']);
        this.frameIdListCondition[i] = [''];
      }
    });
  }

  getRegion() {
      // 是否启用缓存。 写死数据。 不要直接抓包的返回数据。
    if( 1 ){
      let res = {"code":200,"msg":"成功","result":[{"value":"全国","label":"全国","isLeaf":true,"children":[]},{"value":"上海","label":"上海","isLeaf":true,"children":[]},{"value":"北京","label":"北京","isLeaf":true,"children":[]},{"value":"天津","label":"天津","isLeaf":true,"children":[]},{"value":"广东省","label":"广东省","isLeaf":false,"children":[{"value":"广州","label":"广州","isLeaf":true,"children":[]},{"value":"深圳","label":"深圳","isLeaf":true,"children":[]}]},{"value":"江苏省","label":"江苏省","isLeaf":false,"children":[{"value":"南京","label":"南京","isLeaf":true,"children":[]},{"value":"苏州","label":"苏州","isLeaf":true,"children":[]}]},{"value":"浙江省","label":"浙江省","isLeaf":false,"children":[{"value":"杭州","label":"杭州","isLeaf":true,"children":[]}]},{"value":"湖北省","label":"湖北省","isLeaf":false,"children":[{"value":"武汉","label":"武汉","isLeaf":true,"children":[]}]},{"value":"安徽省","label":"安徽省","isLeaf":false,"children":[{"value":"合肥","label":"合肥","isLeaf":true,"children":[]}]},{"value":"福建省","label":"福建省","isLeaf":false,"children":[{"value":"福州","label":"福州","isLeaf":true,"children":[]}]}],"ok":true};
      this.areaOptions = res.result;
      this.areaOptionsAll = res.result;
      this.areaValues.push('');
      return;
    }

    this.cService.getRegion().subscribe(res => {
      //console.log('[getRegion]', JSON.stringify(res));
      this.areaOptions = res.result;
      this.areaOptionsAll = res.result;
      this.areaValues.push('');
    });
  }

    // 发布机构
  getOrgans() {
      // 是否启用缓存。 写死数据。 不要直接抓包的返回数据。
    if( 1 ){
      let res =  {"code":200,"msg":"成功","result":[{"value":"福建省","label":"福建省","isLeaf":false,"children":[{"value":"福建省人民政府","label":"福建省人民政府","isLeaf":true,"children":[]},{"value":"福建省人民政府办公厅","label":"福建省人民政府办公厅","isLeaf":true,"children":[]},{"value":"福州市人民政府","label":"福州市人民政府","isLeaf":true,"children":[]}]},{"value":"浙江省","label":"浙江省","isLeaf":false,"children":[{"value":"杭州市财政局","label":"杭州市财政局","isLeaf":true,"children":[]},{"value":"杭州市人民政府办公厅","label":"杭州市人民政府办公厅","isLeaf":true,"children":[]},{"value":"浙江省人民政府办公厅","label":"浙江省人民政府办公厅","isLeaf":true,"children":[]},{"value":"杭州市科学技术局","label":"杭州市科学技术局","isLeaf":true,"children":[]}]},{"value":"江苏省","label":"江苏省","isLeaf":false,"children":[{"value":"南京市人民政府办公厅","label":"南京市人民政府办公厅","isLeaf":true,"children":[]},{"value":"中共南京市委","label":"中共南京市委","isLeaf":true,"children":[]},{"value":"江苏省人民政府办公厅","label":"江苏省人民政府办公厅","isLeaf":true,"children":[]},{"value":"苏州市人民政府","label":"苏州市人民政府","isLeaf":true,"children":[]},{"value":"江苏省财政厅","label":"江苏省财政厅","isLeaf":true,"children":[]},{"value":"江苏省科学技术厅","label":"江苏省科学技术厅","isLeaf":true,"children":[]},{"value":"南京市人民政府","label":"南京市人民政府","isLeaf":true,"children":[]},{"value":"江苏省科学技术厅 江苏省财政厅","label":"江苏省科学技术厅 江苏省财政厅","isLeaf":true,"children":[]}]},{"value":"上海市","label":"上海市","isLeaf":false,"children":[{"value":"上海市发展和改革委员会","label":"上海市发展和改革委员会","isLeaf":true,"children":[]},{"value":"上海市商务委员会办公室","label":"上海市商务委员会办公室","isLeaf":true,"children":[]},{"value":" 中国（上海）自由贸易试验区临港新片区管理委员会","label":" 中国（上海）自由贸易试验区临港新片区管理委员会","isLeaf":true,"children":[]},{"value":"上海市财政局","label":"上海市财政局","isLeaf":true,"children":[]},{"value":"上海市人民政府","label":"上海市人民政府","isLeaf":true,"children":[]},{"value":"上海市普陀区人民政府办公室","label":"上海市普陀区人民政府办公室","isLeaf":true,"children":[]},{"value":"上海市人力资源和社会保障局","label":"上海市人力资源和社会保障局","isLeaf":true,"children":[]},{"value":"自由贸易试验区临港新片区管理委员会","label":"自由贸易试验区临港新片区管理委员会","isLeaf":true,"children":[]},{"value":"上海市知识产权局","label":"上海市知识产权局","isLeaf":true,"children":[]}]},{"value":"湖北省","label":"湖北省","isLeaf":false,"children":[{"value":"湖北省人民政府","label":"湖北省人民政府","isLeaf":true,"children":[]},{"value":"武汉市人民政府办公厅","label":"武汉市人民政府办公厅","isLeaf":true,"children":[]}]},{"value":"广东省","label":"广东省","isLeaf":false,"children":[{"value":"深圳市地方金融监督管理局","label":"深圳市地方金融监督管理局","isLeaf":true,"children":[]},{"value":"广州市科学技术局","label":"广州市科学技术局","isLeaf":true,"children":[]},{"value":"广东省人民政府办公厅","label":"广东省人民政府办公厅","isLeaf":true,"children":[]},{"value":"深圳市工业和信息化局","label":"深圳市工业和信息化局","isLeaf":true,"children":[]},{"value":"深圳市发展和改革委员会","label":"深圳市发展和改革委员会","isLeaf":true,"children":[]},{"value":"广州开发区金融工作局","label":"广州开发区金融工作局","isLeaf":true,"children":[]},{"value":"广东省科学技术厅","label":"广东省科学技术厅","isLeaf":true,"children":[]},{"value":"深圳市商务局","label":"深圳市商务局","isLeaf":true,"children":[]},{"value":"广州市黄埔区人民政府     广州开发区管理委员会","label":"广州市黄埔区人民政府     广州开发区管理委员会","isLeaf":true,"children":[]},{"value":"广州开发区知识产权局","label":"广州开发区知识产权局","isLeaf":true,"children":[]},{"value":"黄埔区人民政府","label":"黄埔区人民政府","isLeaf":true,"children":[]},{"value":"广州市工业和信息化局","label":"广州市工业和信息化局","isLeaf":true,"children":[]},{"value":"深圳市交通运输局","label":"深圳市交通运输局","isLeaf":true,"children":[]},{"value":"广东省人民政府","label":"广东省人民政府","isLeaf":true,"children":[]},{"value":"深圳市人民政府","label":"深圳市人民政府","isLeaf":true,"children":[]},{"value":"广州南沙开发区管委会办公室 广州市南沙区人民政府办公室","label":"广州南沙开发区管委会办公室 广州市南沙区人民政府办公室","isLeaf":true,"children":[]},{"value":"广州市知识产权局","label":"广州市知识产权局","isLeaf":true,"children":[]},{"value":"广州南沙开发区管委会办公室  广州市南沙区人民政府办公室","label":"广州南沙开发区管委会办公室  广州市南沙区人民政府办公室","isLeaf":true,"children":[]},{"value":"广州市人民政府办公厅","label":"广州市人民政府办公厅","isLeaf":true,"children":[]}]},{"value":"天津市","label":"天津市","isLeaf":false,"children":[{"value":"天津市人民政府办公厅","label":"天津市人民政府办公厅","isLeaf":true,"children":[]},{"value":"天津市人民政府","label":"天津市人民政府","isLeaf":true,"children":[]}]},{"value":"北京市","label":"北京市","isLeaf":false,"children":[{"value":"北京市财政局","label":"北京市财政局","isLeaf":true,"children":[]},{"value":"北京市科学技术委员会","label":"北京市科学技术委员会","isLeaf":true,"children":[]},{"value":"北京市教育委员会","label":"北京市教育委员会","isLeaf":true,"children":[]},{"value":"北京市市场监督管理局","label":"北京市市场监督管理局","isLeaf":true,"children":[]},{"value":"北京市人民代表大会常务委员会","label":"北京市人民代表大会常务委员会","isLeaf":true,"children":[]},{"value":"北京市人力资源和社会保障局","label":"北京市人力资源和社会保障局","isLeaf":true,"children":[]}]},{"value":"全国","label":"全国","isLeaf":false,"children":[{"value":"中国邮政储蓄银行","label":"中国邮政储蓄银行","isLeaf":true,"children":[]},{"value":"中国人民银行","label":"中国人民银行","isLeaf":true,"children":[]},{"value":"中华人民共和国商务部","label":"中华人民共和国商务部","isLeaf":true,"children":[]},{"value":"国家卫生健康委员会","label":"国家卫生健康委员会","isLeaf":true,"children":[]},{"value":"国务院办公厅","label":"国务院办公厅","isLeaf":true,"children":[]},{"value":"中国银行保险监督管理委员会","label":"中国银行保险监督管理委员会","isLeaf":true,"children":[]},{"value":"中华人民共和国财政部","label":"中华人民共和国财政部","isLeaf":true,"children":[]},{"value":"科技部","label":"科技部","isLeaf":true,"children":[]},{"value":"国家税务总局","label":"国家税务总局","isLeaf":true,"children":[]},{"value":"中华人民共和国工业和信息化部","label":"中华人民共和国工业和信息化部","isLeaf":true,"children":[]},{"value":"国务院","label":"国务院","isLeaf":true,"children":[]}]}],"ok":true};
      this.organOptions = res.result;
      this.organOptionsClone = res.result;
      this.organOptionsAll = res.result;
      this.organValues.push('');
      return;
    }

    this.cService.getOrgans().subscribe(res => {
      console.log('[getOrgans]', JSON.stringify(res));
      this.organOptions = res.result;
      this.organOptionsClone = res.result;
      this.organOptionsAll = res.result;
      this.organValues.push('');

    });
  }
    // 文件类型
  getFileList() {
      // 是否启用缓存。 写死数据
    if( 1 ){
      let res = {"code":200,"msg":"成功","result":["计划","方案","条例","规定","其他","决定","公告","规程","批复","通知","细则","办法","函","意见","规划","措施"],"ok":true};
      this.filesOptions = res.result;
      this.fileValues.push('');
      return;
    }

    this.cService.getFileList().subscribe(res => {
      this.filesOptions = res.result;
      this.fileValues.push('');
    });
  }

  getHotSpots() {
    this.cService.getHotSpots().subscribe(res => {
      this.spotList = res.result;
      // debug
      //this.spotList = ['人才绿卡','大数据中心','基础研究','股权','人才引进','重点研发计划'].map(val => { return {label:val,value:val}  });
    });
  }

  onAreaChanges(values: any, valuesType: string[], index: number) {
    this.areaAnalysis.regions = this.onChanges(values, valuesType, index);

    // 发布机构, 只显示当前选中的颁布地域下的。  todo: 选二级的(如广州), 发布机构就显示不出来了。
    //debugger
    if (this.areaAnalysis.regions.length > 0) {
      let that = this;
      let regionSimple = that.areaAnalysis.regions.map(val => {
        return val.replace(/[省市]$/gi, '');
      });
      this.organOptions = this.organOptionsAll.filter(item => {
        let nameSimple = item['value'].replace(/[省市]$/gi, '');
        return regionSimple.indexOf(nameSimple) > -1;
      });
    } else {
      // 如果发布机构取消，则颁发地域恢复最初值
      this.organOptions = this.organOptionsClone;
      this.organValues = [''];
    }
    this.selectResult.emit(this.areaAnalysis);
  }

  onOrganChanges(values: any, valuesType: string[], index: number) {
    this.areaAnalysis.publishOrgan = this.onChanges(values, valuesType, index);
    this.selectResult.emit(this.areaAnalysis);
  }

  onFilesChanges(value: any, values: string[], index: number) {
    if (!value && values.length > 1) {
      values.splice(index, 1);
    }
    for (let i = 0; i < values.length; i++) {
      if (!values[i]) {
        values[i] = '';
      }
    }
    this.areaAnalysis.policyType = values;
    this.selectResult.emit(this.areaAnalysis);
  }


  dateOnChange(result: Date[]): void {
    //console.log('[dateOnChange]', result);
    const start = new Date(result[0]);
    //const startTime = start.getFullYear() + '-' + (start.getMonth() + 1);
    const startTime = start.toISOString().substr(0, 7);
    this.areaAnalysis.startTime = startTime;

    if (result[1]) {
      const end = new Date(result[1]);
      //const endTime = end.getFullYear() + '-' + (end.getMonth() + 1);
      const endTime = end.toISOString().substr(0, 7);
      this.areaAnalysis.endTime = endTime;
    } else {
      //this.areaAnalysis.endTime = '';
    }
    this.selectResult.emit(this.areaAnalysis);
  }

  clearChange(result: Date[]) {
    if (!result.length) {
      this.areaAnalysis.startTime = '';
      this.areaAnalysis.endTime = '';
      this.selectResult.emit(this.areaAnalysis);

    }
  }

  onChanges(values: any, valuesType: string[], index: number) {
    if (values.length === 0 && valuesType.length > 1) {
      // 直接删除行
      valuesType.splice(index, 1);
    }
    // 防止最后一个选择框被删
    else if (values.length === 0 && index === 0) {
      // 点清除后，value为[], 而[]为true，isEmpty的条件不支持判断[]
      valuesType[index] = '';
    }
    let valueList = [];
    for (const valueItem of valuesType) {
      if (valueItem.length > 1) {
        valueList = _.concat(valueList, valueItem[valueItem.length - 1]);
        // valueList.push(valueItem[valueItem.length - 1]);
      } else {
        valueList = _.concat(valueList, valueItem[0]);
        // valueList.push(valueItem[0]);
      }
    }
    if (valueList[0] === undefined) {
      valueList = [];
    }
    return valueList;
  }

  // 科学城、自由贸易区勾选
  specialTwoChange(specialTwo: any[]) {
    if (specialTwo.length) {
      const strArr = [];
      for (const object of specialTwo) {
        if (object.checked) {
          strArr.push(object.value);
        }
      }
      this.areaAnalysis.specialRegion = strArr;
    } else {
      this.areaAnalysis.specialRegion = [];

    }
    this.selectResult.emit(this.areaAnalysis);

  }

  // 国家自主创新示范区, 科技创新中心,综合性国家科学中心。 这三个选择后, 要更新 颁布地域 的下拉选项。
  specialThreeChange(specialThree: any[]) {
    //console.log('[specialThreeChange]', specialThree);
    // 如果有选中的
    if ( specialThree.length  && specialThree.some(function(item){return item.checked;})    ) {
      let strArr = [];
      for (const object of specialThree) {
        if (object.checked) {
          // 取出相同部分，赋给strArr
          if (strArr.length) {
            strArr = _.intersection(this.specialThreeOption[object.value], strArr);
          } else {
            strArr = this.specialThreeOption[object.value];
          }
        }
      }

      // 设置 颁布地域 的下拉选项。
      const treeArr = [];
      //console.log('strArr', strArr);
      for (const strArrElement of strArr) {
        const tree = {
          value: '',
          label: '',
          isLeaf: true,
        };
        tree.value = strArrElement;
        tree.label = strArrElement;
        treeArr.push(tree);
      }
      this.areaOptions = treeArr;

      // 设置 要返回给上层的 地域列表。待优化, 应触发地域切换
      this.areaAnalysis.regions = strArr;

      //console.log(this.areaOptions);
    }else{
      this.areaOptions = this.areaOptionsAll;
      this.areaAnalysis.regions = [];

      // 设置 要返回给上层的 地域列表。待优化, 应触发地域切换
      this.areaValues=[''];
    }

    //console.log('this.selectResult', this.selectResult);
    //console.log('areaOptions', this.areaOptions);

    this.selectResult.emit(this.areaAnalysis);

  }

  // 热点关键词勾选
  spotsChange(spotList: any) {
    const spotSelected = [];
    for (const spot of spotList) {
      if (spot.checked) {
        spotSelected.push(spot.value);
      }
    }
    this.areaAnalysis.key = spotSelected;
    this.selectResult.emit(this.areaAnalysis);

  }

  frameCheck(event: boolean, index: number, id: number) {
    if (event) {
      // 先点一级时，wordFreamId还未被初始化，push会报错，所以这里判断一下
      if (!this.areaAnalysis.wordFreamId) {
        this.areaAnalysis.wordFreamId = [];
      }
      this.frameCheckListCondition[index] = id;
      this.areaAnalysis.wordFreamId.push(this.frameCheckListCondition[index]);
      this.removeEmpty(this.areaAnalysis.wordFreamId);

    } else {
      // 取消一级勾选后，重新刷新参数内容
      this.areaAnalysis.wordFreamId = [];
      this.frameCheckListCondition[index] = '';
      for (const frameId of this.frameIdListCondition) {
        for (const frameIdElement of frameId) {
          if (typeof frameIdElement === 'number') {
            this.areaAnalysis.wordFreamId.push(frameIdElement);
          }
        }
      }
      for (const frameCheck of this.frameCheckListCondition) {
        this.areaAnalysis.wordFreamId.push(frameCheck);
      }
      this.removeEmpty(this.areaAnalysis.wordFreamId);
    }
    this.selectResult.emit(this.areaAnalysis);
  }

// 去掉数组中的空参数
  removeEmpty(list: any[]) {
    for (let i = 0; i < list.length; i++) {
      if (!list[i] && typeof list[i] !== 'number') {
        list.splice(i, 1);
        i--;
      }
    }
  }

  onFrameChanges(list: any[], iIndex: number, jIndex: number) {
    // 当点击清除按钮后，判断变化值为空的情况
    if (list.length) {
      this.frameIdListCondition[iIndex][jIndex] = list[list.length - 1].id;
    } else {
      this.frameIdListCondition[iIndex][jIndex] = '';
    }
    this.areaAnalysis.wordFreamId = [];
    for (const frameId of this.frameIdListCondition) {
      for (const frameIdElement of frameId) {
        if (typeof frameIdElement === 'number') {
          this.areaAnalysis.wordFreamId.push(frameIdElement);
        }
      }
    }
    // 重新压入一级被选中的节点
    for (const frameCheck of this.frameCheckListCondition) {
      this.areaAnalysis.wordFreamId.push(frameCheck);
    }
    this.removeEmpty(this.areaAnalysis.wordFreamId);
    this.selectResult.emit(this.areaAnalysis);
  }

  // addFrameItem(list: any[]) {
  //   list.push('');
  // }

  isEmptyFrame(list: any, index: number) {
    for (const item of list) {
      if (!item) {
        this.message.warning('请先选择一个条件');
        return false;
      }
    }
    this.frameIdList[index].push('');
  }

  isEmpty(list: string[]) {
    for (const item of list) {
      if (!item) {
        this.message.warning('请先选择一个条件');
        return false;
      }
    }
    list.push('');
  }
}
